package tools.jackson.module.kotlin.kogeraIntegration.deser.valueClass.parameterSize.nullableObject

import com.fasterxml.jackson.annotation.JsonCreator
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import tools.jackson.module.kotlin.assertReflectEquals
import tools.jackson.module.kotlin.callPrimaryConstructor
import tools.jackson.module.kotlin.defaultMapper
import tools.jackson.module.kotlin.kogeraIntegration.deser.valueClass.NullableObject
import tools.jackson.module.kotlin.readValue

// Convert the property p to q (but not the value) to make it an input to the factory function.
private fun replacePQ(src: String) = src.replace(Regex("""p\d+":""")) { "q" + it.value.substring(1) }

/**
 * Up to argument size 32 there is one mask argument for the default argument,
 * 33 ~ 64 there are two, and 65 there are three, so each boundary value is tested.
 * Also, the maximum size of arguments that can be set by a constructor
 * that includes a value class as an argument is 253 (one less by DefaultConstructorMarker), so test that case as well.
 */
class DeserializeByFactoryWithoutDefaultArgumentsTest {
    data class Dst32(
        val p00: NullableObject,
        val p01: NullableObject,
        val p02: NullableObject,
        val p03: NullableObject,
        val p04: NullableObject,
        val p05: NullableObject,
        val p06: NullableObject,
        val p07: NullableObject,
        val p08: NullableObject,
        val p09: NullableObject,
        val p10: NullableObject,
        val p11: NullableObject,
        val p12: NullableObject,
        val p13: NullableObject,
        val p14: NullableObject,
        val p15: NullableObject,
        val p16: NullableObject,
        val p17: NullableObject,
        val p18: NullableObject,
        val p19: NullableObject,
        val p20: NullableObject,
        val p21: NullableObject,
        val p22: NullableObject,
        val p23: NullableObject,
        val p24: NullableObject,
        val p25: NullableObject,
        val p26: NullableObject,
        val p27: NullableObject,
        val p28: NullableObject,
        val p29: NullableObject,
        val p30: NullableObject,
        val p31: NullableObject
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NullableObject,
                q01: NullableObject,
                q02: NullableObject,
                q03: NullableObject,
                q04: NullableObject,
                q05: NullableObject,
                q06: NullableObject,
                q07: NullableObject,
                q08: NullableObject,
                q09: NullableObject,
                q10: NullableObject,
                q11: NullableObject,
                q12: NullableObject,
                q13: NullableObject,
                q14: NullableObject,
                q15: NullableObject,
                q16: NullableObject,
                q17: NullableObject,
                q18: NullableObject,
                q19: NullableObject,
                q20: NullableObject,
                q21: NullableObject,
                q22: NullableObject,
                q23: NullableObject,
                q24: NullableObject,
                q25: NullableObject,
                q26: NullableObject,
                q27: NullableObject,
                q28: NullableObject,
                q29: NullableObject,
                q30: NullableObject,
                q31: NullableObject
            ) = Dst32(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31
            )
        }
    }

    @Test
    fun test32() {
        val expected = callPrimaryConstructor<Dst32> { NullableObject(it.name!!) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertEquals(expected, defaultMapper.readValue<Dst32>(src))
    }

    data class Dst33(
        val p00: NullableObject,
        val p01: NullableObject,
        val p02: NullableObject,
        val p03: NullableObject,
        val p04: NullableObject,
        val p05: NullableObject,
        val p06: NullableObject,
        val p07: NullableObject,
        val p08: NullableObject,
        val p09: NullableObject,
        val p10: NullableObject,
        val p11: NullableObject,
        val p12: NullableObject,
        val p13: NullableObject,
        val p14: NullableObject,
        val p15: NullableObject,
        val p16: NullableObject,
        val p17: NullableObject,
        val p18: NullableObject,
        val p19: NullableObject,
        val p20: NullableObject,
        val p21: NullableObject,
        val p22: NullableObject,
        val p23: NullableObject,
        val p24: NullableObject,
        val p25: NullableObject,
        val p26: NullableObject,
        val p27: NullableObject,
        val p28: NullableObject,
        val p29: NullableObject,
        val p30: NullableObject,
        val p31: NullableObject,
        val p32: NullableObject
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NullableObject,
                q01: NullableObject,
                q02: NullableObject,
                q03: NullableObject,
                q04: NullableObject,
                q05: NullableObject,
                q06: NullableObject,
                q07: NullableObject,
                q08: NullableObject,
                q09: NullableObject,
                q10: NullableObject,
                q11: NullableObject,
                q12: NullableObject,
                q13: NullableObject,
                q14: NullableObject,
                q15: NullableObject,
                q16: NullableObject,
                q17: NullableObject,
                q18: NullableObject,
                q19: NullableObject,
                q20: NullableObject,
                q21: NullableObject,
                q22: NullableObject,
                q23: NullableObject,
                q24: NullableObject,
                q25: NullableObject,
                q26: NullableObject,
                q27: NullableObject,
                q28: NullableObject,
                q29: NullableObject,
                q30: NullableObject,
                q31: NullableObject,
                q32: NullableObject
            ) = Dst33(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31,
                q32
            )
        }
    }

    @Test
    fun test33() {
        val expected = callPrimaryConstructor<Dst33> { NullableObject(it.name!!) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertEquals(expected, defaultMapper.readValue<Dst33>(src))
    }

    data class Dst64(
        val p00: NullableObject,
        val p01: NullableObject,
        val p02: NullableObject,
        val p03: NullableObject,
        val p04: NullableObject,
        val p05: NullableObject,
        val p06: NullableObject,
        val p07: NullableObject,
        val p08: NullableObject,
        val p09: NullableObject,
        val p10: NullableObject,
        val p11: NullableObject,
        val p12: NullableObject,
        val p13: NullableObject,
        val p14: NullableObject,
        val p15: NullableObject,
        val p16: NullableObject,
        val p17: NullableObject,
        val p18: NullableObject,
        val p19: NullableObject,
        val p20: NullableObject,
        val p21: NullableObject,
        val p22: NullableObject,
        val p23: NullableObject,
        val p24: NullableObject,
        val p25: NullableObject,
        val p26: NullableObject,
        val p27: NullableObject,
        val p28: NullableObject,
        val p29: NullableObject,
        val p30: NullableObject,
        val p31: NullableObject,
        val p32: NullableObject,
        val p33: NullableObject,
        val p34: NullableObject,
        val p35: NullableObject,
        val p36: NullableObject,
        val p37: NullableObject,
        val p38: NullableObject,
        val p39: NullableObject,
        val p40: NullableObject,
        val p41: NullableObject,
        val p42: NullableObject,
        val p43: NullableObject,
        val p44: NullableObject,
        val p45: NullableObject,
        val p46: NullableObject,
        val p47: NullableObject,
        val p48: NullableObject,
        val p49: NullableObject,
        val p50: NullableObject,
        val p51: NullableObject,
        val p52: NullableObject,
        val p53: NullableObject,
        val p54: NullableObject,
        val p55: NullableObject,
        val p56: NullableObject,
        val p57: NullableObject,
        val p58: NullableObject,
        val p59: NullableObject,
        val p60: NullableObject,
        val p61: NullableObject,
        val p62: NullableObject,
        val p63: NullableObject
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NullableObject,
                q01: NullableObject,
                q02: NullableObject,
                q03: NullableObject,
                q04: NullableObject,
                q05: NullableObject,
                q06: NullableObject,
                q07: NullableObject,
                q08: NullableObject,
                q09: NullableObject,
                q10: NullableObject,
                q11: NullableObject,
                q12: NullableObject,
                q13: NullableObject,
                q14: NullableObject,
                q15: NullableObject,
                q16: NullableObject,
                q17: NullableObject,
                q18: NullableObject,
                q19: NullableObject,
                q20: NullableObject,
                q21: NullableObject,
                q22: NullableObject,
                q23: NullableObject,
                q24: NullableObject,
                q25: NullableObject,
                q26: NullableObject,
                q27: NullableObject,
                q28: NullableObject,
                q29: NullableObject,
                q30: NullableObject,
                q31: NullableObject,
                q32: NullableObject,
                q33: NullableObject,
                q34: NullableObject,
                q35: NullableObject,
                q36: NullableObject,
                q37: NullableObject,
                q38: NullableObject,
                q39: NullableObject,
                q40: NullableObject,
                q41: NullableObject,
                q42: NullableObject,
                q43: NullableObject,
                q44: NullableObject,
                q45: NullableObject,
                q46: NullableObject,
                q47: NullableObject,
                q48: NullableObject,
                q49: NullableObject,
                q50: NullableObject,
                q51: NullableObject,
                q52: NullableObject,
                q53: NullableObject,
                q54: NullableObject,
                q55: NullableObject,
                q56: NullableObject,
                q57: NullableObject,
                q58: NullableObject,
                q59: NullableObject,
                q60: NullableObject,
                q61: NullableObject,
                q62: NullableObject,
                q63: NullableObject
            ) = Dst64(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31,
                q32,
                q33,
                q34,
                q35,
                q36,
                q37,
                q38,
                q39,
                q40,
                q41,
                q42,
                q43,
                q44,
                q45,
                q46,
                q47,
                q48,
                q49,
                q50,
                q51,
                q52,
                q53,
                q54,
                q55,
                q56,
                q57,
                q58,
                q59,
                q60,
                q61,
                q62,
                q63
            )
        }
    }

    @Test
    fun test64() {
        val expected = callPrimaryConstructor<Dst64> { NullableObject(it.name!!) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertEquals(expected, defaultMapper.readValue<Dst64>(src))
    }

    data class Dst65(
        val p00: NullableObject,
        val p01: NullableObject,
        val p02: NullableObject,
        val p03: NullableObject,
        val p04: NullableObject,
        val p05: NullableObject,
        val p06: NullableObject,
        val p07: NullableObject,
        val p08: NullableObject,
        val p09: NullableObject,
        val p10: NullableObject,
        val p11: NullableObject,
        val p12: NullableObject,
        val p13: NullableObject,
        val p14: NullableObject,
        val p15: NullableObject,
        val p16: NullableObject,
        val p17: NullableObject,
        val p18: NullableObject,
        val p19: NullableObject,
        val p20: NullableObject,
        val p21: NullableObject,
        val p22: NullableObject,
        val p23: NullableObject,
        val p24: NullableObject,
        val p25: NullableObject,
        val p26: NullableObject,
        val p27: NullableObject,
        val p28: NullableObject,
        val p29: NullableObject,
        val p30: NullableObject,
        val p31: NullableObject,
        val p32: NullableObject,
        val p33: NullableObject,
        val p34: NullableObject,
        val p35: NullableObject,
        val p36: NullableObject,
        val p37: NullableObject,
        val p38: NullableObject,
        val p39: NullableObject,
        val p40: NullableObject,
        val p41: NullableObject,
        val p42: NullableObject,
        val p43: NullableObject,
        val p44: NullableObject,
        val p45: NullableObject,
        val p46: NullableObject,
        val p47: NullableObject,
        val p48: NullableObject,
        val p49: NullableObject,
        val p50: NullableObject,
        val p51: NullableObject,
        val p52: NullableObject,
        val p53: NullableObject,
        val p54: NullableObject,
        val p55: NullableObject,
        val p56: NullableObject,
        val p57: NullableObject,
        val p58: NullableObject,
        val p59: NullableObject,
        val p60: NullableObject,
        val p61: NullableObject,
        val p62: NullableObject,
        val p63: NullableObject,
        val p64: NullableObject
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q00: NullableObject,
                q01: NullableObject,
                q02: NullableObject,
                q03: NullableObject,
                q04: NullableObject,
                q05: NullableObject,
                q06: NullableObject,
                q07: NullableObject,
                q08: NullableObject,
                q09: NullableObject,
                q10: NullableObject,
                q11: NullableObject,
                q12: NullableObject,
                q13: NullableObject,
                q14: NullableObject,
                q15: NullableObject,
                q16: NullableObject,
                q17: NullableObject,
                q18: NullableObject,
                q19: NullableObject,
                q20: NullableObject,
                q21: NullableObject,
                q22: NullableObject,
                q23: NullableObject,
                q24: NullableObject,
                q25: NullableObject,
                q26: NullableObject,
                q27: NullableObject,
                q28: NullableObject,
                q29: NullableObject,
                q30: NullableObject,
                q31: NullableObject,
                q32: NullableObject,
                q33: NullableObject,
                q34: NullableObject,
                q35: NullableObject,
                q36: NullableObject,
                q37: NullableObject,
                q38: NullableObject,
                q39: NullableObject,
                q40: NullableObject,
                q41: NullableObject,
                q42: NullableObject,
                q43: NullableObject,
                q44: NullableObject,
                q45: NullableObject,
                q46: NullableObject,
                q47: NullableObject,
                q48: NullableObject,
                q49: NullableObject,
                q50: NullableObject,
                q51: NullableObject,
                q52: NullableObject,
                q53: NullableObject,
                q54: NullableObject,
                q55: NullableObject,
                q56: NullableObject,
                q57: NullableObject,
                q58: NullableObject,
                q59: NullableObject,
                q60: NullableObject,
                q61: NullableObject,
                q62: NullableObject,
                q63: NullableObject,
                q64: NullableObject
            ) = Dst65(
                q00,
                q01,
                q02,
                q03,
                q04,
                q05,
                q06,
                q07,
                q08,
                q09,
                q10,
                q11,
                q12,
                q13,
                q14,
                q15,
                q16,
                q17,
                q18,
                q19,
                q20,
                q21,
                q22,
                q23,
                q24,
                q25,
                q26,
                q27,
                q28,
                q29,
                q30,
                q31,
                q32,
                q33,
                q34,
                q35,
                q36,
                q37,
                q38,
                q39,
                q40,
                q41,
                q42,
                q43,
                q44,
                q45,
                q46,
                q47,
                q48,
                q49,
                q50,
                q51,
                q52,
                q53,
                q54,
                q55,
                q56,
                q57,
                q58,
                q59,
                q60,
                q61,
                q62,
                q63,
                q64
            )
        }
    }

    @Test
    fun test65() {
        val expected = callPrimaryConstructor<Dst65> { NullableObject(it.name!!) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertEquals(expected, defaultMapper.readValue<Dst65>(src))
    }

    // It cannot be a data class because the generated method would exceed the argument size limit.
    class DstMax(
        val p000: NullableObject,
        val p001: NullableObject,
        val p002: NullableObject,
        val p003: NullableObject,
        val p004: NullableObject,
        val p005: NullableObject,
        val p006: NullableObject,
        val p007: NullableObject,
        val p008: NullableObject,
        val p009: NullableObject,
        val p010: NullableObject,
        val p011: NullableObject,
        val p012: NullableObject,
        val p013: NullableObject,
        val p014: NullableObject,
        val p015: NullableObject,
        val p016: NullableObject,
        val p017: NullableObject,
        val p018: NullableObject,
        val p019: NullableObject,
        val p020: NullableObject,
        val p021: NullableObject,
        val p022: NullableObject,
        val p023: NullableObject,
        val p024: NullableObject,
        val p025: NullableObject,
        val p026: NullableObject,
        val p027: NullableObject,
        val p028: NullableObject,
        val p029: NullableObject,
        val p030: NullableObject,
        val p031: NullableObject,
        val p032: NullableObject,
        val p033: NullableObject,
        val p034: NullableObject,
        val p035: NullableObject,
        val p036: NullableObject,
        val p037: NullableObject,
        val p038: NullableObject,
        val p039: NullableObject,
        val p040: NullableObject,
        val p041: NullableObject,
        val p042: NullableObject,
        val p043: NullableObject,
        val p044: NullableObject,
        val p045: NullableObject,
        val p046: NullableObject,
        val p047: NullableObject,
        val p048: NullableObject,
        val p049: NullableObject,
        val p050: NullableObject,
        val p051: NullableObject,
        val p052: NullableObject,
        val p053: NullableObject,
        val p054: NullableObject,
        val p055: NullableObject,
        val p056: NullableObject,
        val p057: NullableObject,
        val p058: NullableObject,
        val p059: NullableObject,
        val p060: NullableObject,
        val p061: NullableObject,
        val p062: NullableObject,
        val p063: NullableObject,
        val p064: NullableObject,
        val p065: NullableObject,
        val p066: NullableObject,
        val p067: NullableObject,
        val p068: NullableObject,
        val p069: NullableObject,
        val p070: NullableObject,
        val p071: NullableObject,
        val p072: NullableObject,
        val p073: NullableObject,
        val p074: NullableObject,
        val p075: NullableObject,
        val p076: NullableObject,
        val p077: NullableObject,
        val p078: NullableObject,
        val p079: NullableObject,
        val p080: NullableObject,
        val p081: NullableObject,
        val p082: NullableObject,
        val p083: NullableObject,
        val p084: NullableObject,
        val p085: NullableObject,
        val p086: NullableObject,
        val p087: NullableObject,
        val p088: NullableObject,
        val p089: NullableObject,
        val p090: NullableObject,
        val p091: NullableObject,
        val p092: NullableObject,
        val p093: NullableObject,
        val p094: NullableObject,
        val p095: NullableObject,
        val p096: NullableObject,
        val p097: NullableObject,
        val p098: NullableObject,
        val p099: NullableObject,
        val p100: NullableObject,
        val p101: NullableObject,
        val p102: NullableObject,
        val p103: NullableObject,
        val p104: NullableObject,
        val p105: NullableObject,
        val p106: NullableObject,
        val p107: NullableObject,
        val p108: NullableObject,
        val p109: NullableObject,
        val p110: NullableObject,
        val p111: NullableObject,
        val p112: NullableObject,
        val p113: NullableObject,
        val p114: NullableObject,
        val p115: NullableObject,
        val p116: NullableObject,
        val p117: NullableObject,
        val p118: NullableObject,
        val p119: NullableObject,
        val p120: NullableObject,
        val p121: NullableObject,
        val p122: NullableObject,
        val p123: NullableObject,
        val p124: NullableObject,
        val p125: NullableObject,
        val p126: NullableObject,
        val p127: NullableObject,
        val p128: NullableObject,
        val p129: NullableObject,
        val p130: NullableObject,
        val p131: NullableObject,
        val p132: NullableObject,
        val p133: NullableObject,
        val p134: NullableObject,
        val p135: NullableObject,
        val p136: NullableObject,
        val p137: NullableObject,
        val p138: NullableObject,
        val p139: NullableObject,
        val p140: NullableObject,
        val p141: NullableObject,
        val p142: NullableObject,
        val p143: NullableObject,
        val p144: NullableObject,
        val p145: NullableObject,
        val p146: NullableObject,
        val p147: NullableObject,
        val p148: NullableObject,
        val p149: NullableObject,
        val p150: NullableObject,
        val p151: NullableObject,
        val p152: NullableObject,
        val p153: NullableObject,
        val p154: NullableObject,
        val p155: NullableObject,
        val p156: NullableObject,
        val p157: NullableObject,
        val p158: NullableObject,
        val p159: NullableObject,
        val p160: NullableObject,
        val p161: NullableObject,
        val p162: NullableObject,
        val p163: NullableObject,
        val p164: NullableObject,
        val p165: NullableObject,
        val p166: NullableObject,
        val p167: NullableObject,
        val p168: NullableObject,
        val p169: NullableObject,
        val p170: NullableObject,
        val p171: NullableObject,
        val p172: NullableObject,
        val p173: NullableObject,
        val p174: NullableObject,
        val p175: NullableObject,
        val p176: NullableObject,
        val p177: NullableObject,
        val p178: NullableObject,
        val p179: NullableObject,
        val p180: NullableObject,
        val p181: NullableObject,
        val p182: NullableObject,
        val p183: NullableObject,
        val p184: NullableObject,
        val p185: NullableObject,
        val p186: NullableObject,
        val p187: NullableObject,
        val p188: NullableObject,
        val p189: NullableObject,
        val p190: NullableObject,
        val p191: NullableObject,
        val p192: NullableObject,
        val p193: NullableObject,
        val p194: NullableObject,
        val p195: NullableObject,
        val p196: NullableObject,
        val p197: NullableObject,
        val p198: NullableObject,
        val p199: NullableObject,
        val p200: NullableObject,
        val p201: NullableObject,
        val p202: NullableObject,
        val p203: NullableObject,
        val p204: NullableObject,
        val p205: NullableObject,
        val p206: NullableObject,
        val p207: NullableObject,
        val p208: NullableObject,
        val p209: NullableObject,
        val p210: NullableObject,
        val p211: NullableObject,
        val p212: NullableObject,
        val p213: NullableObject,
        val p214: NullableObject,
        val p215: NullableObject,
        val p216: NullableObject,
        val p217: NullableObject,
        val p218: NullableObject,
        val p219: NullableObject,
        val p220: NullableObject,
        val p221: NullableObject,
        val p222: NullableObject,
        val p223: NullableObject,
        val p224: NullableObject,
        val p225: NullableObject,
        val p226: NullableObject,
        val p227: NullableObject,
        val p228: NullableObject,
        val p229: NullableObject,
        val p230: NullableObject,
        val p231: NullableObject,
        val p232: NullableObject,
        val p233: NullableObject,
        val p234: NullableObject,
        val p235: NullableObject,
        val p236: NullableObject,
        val p237: NullableObject,
        val p238: NullableObject,
        val p239: NullableObject,
        val p240: NullableObject,
        val p241: NullableObject,
        val p242: NullableObject,
        val p243: NullableObject,
        val p244: NullableObject,
        val p245: NullableObject,
        val p246: NullableObject,
        val p247: NullableObject,
        val p248: NullableObject,
        val p249: NullableObject,
        val p250: NullableObject,
        val p251: NullableObject,
        val p252: NullableObject
    ) {
        companion object {
            @JvmStatic
            @JsonCreator
            fun creator(
                q000: NullableObject,
                q001: NullableObject,
                q002: NullableObject,
                q003: NullableObject,
                q004: NullableObject,
                q005: NullableObject,
                q006: NullableObject,
                q007: NullableObject,
                q008: NullableObject,
                q009: NullableObject,
                q010: NullableObject,
                q011: NullableObject,
                q012: NullableObject,
                q013: NullableObject,
                q014: NullableObject,
                q015: NullableObject,
                q016: NullableObject,
                q017: NullableObject,
                q018: NullableObject,
                q019: NullableObject,
                q020: NullableObject,
                q021: NullableObject,
                q022: NullableObject,
                q023: NullableObject,
                q024: NullableObject,
                q025: NullableObject,
                q026: NullableObject,
                q027: NullableObject,
                q028: NullableObject,
                q029: NullableObject,
                q030: NullableObject,
                q031: NullableObject,
                q032: NullableObject,
                q033: NullableObject,
                q034: NullableObject,
                q035: NullableObject,
                q036: NullableObject,
                q037: NullableObject,
                q038: NullableObject,
                q039: NullableObject,
                q040: NullableObject,
                q041: NullableObject,
                q042: NullableObject,
                q043: NullableObject,
                q044: NullableObject,
                q045: NullableObject,
                q046: NullableObject,
                q047: NullableObject,
                q048: NullableObject,
                q049: NullableObject,
                q050: NullableObject,
                q051: NullableObject,
                q052: NullableObject,
                q053: NullableObject,
                q054: NullableObject,
                q055: NullableObject,
                q056: NullableObject,
                q057: NullableObject,
                q058: NullableObject,
                q059: NullableObject,
                q060: NullableObject,
                q061: NullableObject,
                q062: NullableObject,
                q063: NullableObject,
                q064: NullableObject,
                q065: NullableObject,
                q066: NullableObject,
                q067: NullableObject,
                q068: NullableObject,
                q069: NullableObject,
                q070: NullableObject,
                q071: NullableObject,
                q072: NullableObject,
                q073: NullableObject,
                q074: NullableObject,
                q075: NullableObject,
                q076: NullableObject,
                q077: NullableObject,
                q078: NullableObject,
                q079: NullableObject,
                q080: NullableObject,
                q081: NullableObject,
                q082: NullableObject,
                q083: NullableObject,
                q084: NullableObject,
                q085: NullableObject,
                q086: NullableObject,
                q087: NullableObject,
                q088: NullableObject,
                q089: NullableObject,
                q090: NullableObject,
                q091: NullableObject,
                q092: NullableObject,
                q093: NullableObject,
                q094: NullableObject,
                q095: NullableObject,
                q096: NullableObject,
                q097: NullableObject,
                q098: NullableObject,
                q099: NullableObject,
                q100: NullableObject,
                q101: NullableObject,
                q102: NullableObject,
                q103: NullableObject,
                q104: NullableObject,
                q105: NullableObject,
                q106: NullableObject,
                q107: NullableObject,
                q108: NullableObject,
                q109: NullableObject,
                q110: NullableObject,
                q111: NullableObject,
                q112: NullableObject,
                q113: NullableObject,
                q114: NullableObject,
                q115: NullableObject,
                q116: NullableObject,
                q117: NullableObject,
                q118: NullableObject,
                q119: NullableObject,
                q120: NullableObject,
                q121: NullableObject,
                q122: NullableObject,
                q123: NullableObject,
                q124: NullableObject,
                q125: NullableObject,
                q126: NullableObject,
                q127: NullableObject,
                q128: NullableObject,
                q129: NullableObject,
                q130: NullableObject,
                q131: NullableObject,
                q132: NullableObject,
                q133: NullableObject,
                q134: NullableObject,
                q135: NullableObject,
                q136: NullableObject,
                q137: NullableObject,
                q138: NullableObject,
                q139: NullableObject,
                q140: NullableObject,
                q141: NullableObject,
                q142: NullableObject,
                q143: NullableObject,
                q144: NullableObject,
                q145: NullableObject,
                q146: NullableObject,
                q147: NullableObject,
                q148: NullableObject,
                q149: NullableObject,
                q150: NullableObject,
                q151: NullableObject,
                q152: NullableObject,
                q153: NullableObject,
                q154: NullableObject,
                q155: NullableObject,
                q156: NullableObject,
                q157: NullableObject,
                q158: NullableObject,
                q159: NullableObject,
                q160: NullableObject,
                q161: NullableObject,
                q162: NullableObject,
                q163: NullableObject,
                q164: NullableObject,
                q165: NullableObject,
                q166: NullableObject,
                q167: NullableObject,
                q168: NullableObject,
                q169: NullableObject,
                q170: NullableObject,
                q171: NullableObject,
                q172: NullableObject,
                q173: NullableObject,
                q174: NullableObject,
                q175: NullableObject,
                q176: NullableObject,
                q177: NullableObject,
                q178: NullableObject,
                q179: NullableObject,
                q180: NullableObject,
                q181: NullableObject,
                q182: NullableObject,
                q183: NullableObject,
                q184: NullableObject,
                q185: NullableObject,
                q186: NullableObject,
                q187: NullableObject,
                q188: NullableObject,
                q189: NullableObject,
                q190: NullableObject,
                q191: NullableObject,
                q192: NullableObject,
                q193: NullableObject,
                q194: NullableObject,
                q195: NullableObject,
                q196: NullableObject,
                q197: NullableObject,
                q198: NullableObject,
                q199: NullableObject,
                q200: NullableObject,
                q201: NullableObject,
                q202: NullableObject,
                q203: NullableObject,
                q204: NullableObject,
                q205: NullableObject,
                q206: NullableObject,
                q207: NullableObject,
                q208: NullableObject,
                q209: NullableObject,
                q210: NullableObject,
                q211: NullableObject,
                q212: NullableObject,
                q213: NullableObject,
                q214: NullableObject,
                q215: NullableObject,
                q216: NullableObject,
                q217: NullableObject,
                q218: NullableObject,
                q219: NullableObject,
                q220: NullableObject,
                q221: NullableObject,
                q222: NullableObject,
                q223: NullableObject,
                q224: NullableObject,
                q225: NullableObject,
                q226: NullableObject,
                q227: NullableObject,
                q228: NullableObject,
                q229: NullableObject,
                q230: NullableObject,
                q231: NullableObject,
                q232: NullableObject,
                q233: NullableObject,
                q234: NullableObject,
                q235: NullableObject,
                q236: NullableObject,
                q237: NullableObject,
                q238: NullableObject,
                q239: NullableObject,
                q240: NullableObject,
                q241: NullableObject,
                q242: NullableObject,
                q243: NullableObject,
                q244: NullableObject,
                q245: NullableObject,
                q246: NullableObject,
                q247: NullableObject,
                q248: NullableObject,
                q249: NullableObject,
                q250: NullableObject,
                q251: NullableObject,
                q252: NullableObject
            ) = DstMax(
                q000,
                q001,
                q002,
                q003,
                q004,
                q005,
                q006,
                q007,
                q008,
                q009,
                q010,
                q011,
                q012,
                q013,
                q014,
                q015,
                q016,
                q017,
                q018,
                q019,
                q020,
                q021,
                q022,
                q023,
                q024,
                q025,
                q026,
                q027,
                q028,
                q029,
                q030,
                q031,
                q032,
                q033,
                q034,
                q035,
                q036,
                q037,
                q038,
                q039,
                q040,
                q041,
                q042,
                q043,
                q044,
                q045,
                q046,
                q047,
                q048,
                q049,
                q050,
                q051,
                q052,
                q053,
                q054,
                q055,
                q056,
                q057,
                q058,
                q059,
                q060,
                q061,
                q062,
                q063,
                q064,
                q065,
                q066,
                q067,
                q068,
                q069,
                q070,
                q071,
                q072,
                q073,
                q074,
                q075,
                q076,
                q077,
                q078,
                q079,
                q080,
                q081,
                q082,
                q083,
                q084,
                q085,
                q086,
                q087,
                q088,
                q089,
                q090,
                q091,
                q092,
                q093,
                q094,
                q095,
                q096,
                q097,
                q098,
                q099,
                q100,
                q101,
                q102,
                q103,
                q104,
                q105,
                q106,
                q107,
                q108,
                q109,
                q110,
                q111,
                q112,
                q113,
                q114,
                q115,
                q116,
                q117,
                q118,
                q119,
                q120,
                q121,
                q122,
                q123,
                q124,
                q125,
                q126,
                q127,
                q128,
                q129,
                q130,
                q131,
                q132,
                q133,
                q134,
                q135,
                q136,
                q137,
                q138,
                q139,
                q140,
                q141,
                q142,
                q143,
                q144,
                q145,
                q146,
                q147,
                q148,
                q149,
                q150,
                q151,
                q152,
                q153,
                q154,
                q155,
                q156,
                q157,
                q158,
                q159,
                q160,
                q161,
                q162,
                q163,
                q164,
                q165,
                q166,
                q167,
                q168,
                q169,
                q170,
                q171,
                q172,
                q173,
                q174,
                q175,
                q176,
                q177,
                q178,
                q179,
                q180,
                q181,
                q182,
                q183,
                q184,
                q185,
                q186,
                q187,
                q188,
                q189,
                q190,
                q191,
                q192,
                q193,
                q194,
                q195,
                q196,
                q197,
                q198,
                q199,
                q200,
                q201,
                q202,
                q203,
                q204,
                q205,
                q206,
                q207,
                q208,
                q209,
                q210,
                q211,
                q212,
                q213,
                q214,
                q215,
                q216,
                q217,
                q218,
                q219,
                q220,
                q221,
                q222,
                q223,
                q224,
                q225,
                q226,
                q227,
                q228,
                q229,
                q230,
                q231,
                q232,
                q233,
                q234,
                q235,
                q236,
                q237,
                q238,
                q239,
                q240,
                q241,
                q242,
                q243,
                q244,
                q245,
                q246,
                q247,
                q248,
                q249,
                q250,
                q251,
                q252
            )
        }
    }

    @Test
    fun testMax() {
        val expected = callPrimaryConstructor<DstMax> { NullableObject(it.name!!) }
        val src = replacePQ(defaultMapper.writeValueAsString(expected))
        assertReflectEquals(expected, defaultMapper.readValue<DstMax>(src))
    }
}
